import { request } from 'umi';

//查询授权申请列表
export async function getAuthorizationApplyListRequestData(
    options?: {[key: string]: any;
}){
    return  request<AircasKB.ResponseType<AircasKB.KnowledgeApply.AuthorizationApplyListResponse[]>>(
        `/aircaskb/knowledgeAuthorization/applyList`,
        {
            method: 'GET',
            ...(options || {}),
        });
}

//申请授权
export async function getAuthorizationApplyRequestData(
    body:AircasKB.KnowledgeApply.AuthorizationApplyRequestParams,
    options?: {[key: string]: any;
    }){
    return  request<AircasKB.ResponseType<AircasKB.KnowledgeApply.AuthorizationApplyResponse>>(
        `/aircaskb/knowledgeAuthorization/apply`,
        {
            method: 'POST',
            data:body,
            ...(options || {}),
        });
}

//授权
export async function getAuthorizationPermissionRequestData(
    body:AircasKB.KnowledgeApply.AuthorizationPermissionRequestParams,
    options?: {[key: string]: any;
    }){
    const { id } = body;
    return  request<AircasKB.ResponseType<AircasKB.KnowledgeApply.AuthorizationPermissionResponse>>(
        `/aircaskb/knowledgeAuthorization/permission?id=${id}`,
        {
            method: 'GET',
            ...(options || {}),
        });
}

//拒绝授权
export async function getAuthorizationRejectPermissionRequestData(
    body:AircasKB.KnowledgeApply.AuthorizationRejectPermissionRequestParams,
    options?: {[key: string]: any;
    }){
    const { id } = body;
    return  request<AircasKB.ResponseType<AircasKB.KnowledgeApply.AuthorizationRejectPermissionResponse>>(
        `/aircaskb/knowledgeAuthorization/reject?id=${id}`,
        {
            method: 'GET',
            ...(options || {}),
        });
}


